package work.parabola.assets.common;

/**
 * 常量类，用于存储系统中用到的所有常量
 * @author 黄松祥
 * 2018年2月6日 下午4:42:18
 */

public class Const {
	
	/**
	 * 在session中存储健名
	 */
	public static final String CURRENT_USER = "currentUser";
	
	/**
	 * 用于webservice中标志系统id，本系统为温州市征信合规管理系统，系统标志为2
	 */
	public static final Integer SYSTEM_ID = 2;
	
	/**
	 * 模板、通知、法律法规发送目标枚举
	 */
	public enum Target{
		ALL("0", "所有机构"),
		CENTRAL_BANK("A", "人民银行"),
		COMMERCIAL_BANK("C", "商业银行");
		private String code;
		private String value;
		
		private Target(String code, String value) {
			this.code = code;
			this.value = value;
		}

		public String getCode() {
			return code;
		}

		public String getValue() {
			return value;
		}
		public static Target codeOf(String code){
            for(Target target : values()){
            	if(target.getCode().equals(code)) {
            		return target;
            	}
            }
            return null;
        }
	}

	
	/**
	 * 个人证件类型
	 */
	public enum CertType {
		ID(0, "身份证"),
		RESIDENCE(1, "户口薄"),
		PASSPORT(2, "护照"),
		MILITARY_OFFICER_CERT(3, "军官证"),
		SOLDBUCH(4, "士兵证"),
		HK_MACAU_TRAVEL_PERMIT(5, "港澳居民来往内地通行证"),
		TAIWAN_TRAVEL_PERMIT(6, "台湾同胞来往内地通行证"),
		FOREIGNERS_RESIDENCE_PERMIT(7, "外国人居留证"),
		POLICE_CARD(8, "警官证"),
		OTHER_ID(9, "其他证件"),
		UNION_CODE(10, "统一社会信用代码"),
		CREDIT_CODE(11, "中征码"),
		ORG_CODE(12, "组织机构代码证");
		
		private int code;
		private String value;
		
		private CertType(int code, String value) {
			this.code = code;
			this.value = value;
		}
		
		public int getCode() {
			return code;
		}

		public String getValue() {
			return value;
		}

		public static CertType codeOf(int code){
            for(CertType certType : values()){
                if(certType.getCode() == code){
                    return certType;
                }
            }
            return null;
        }
	}
	
	/**
	 * 
	 * 角色信息
	 */
	public interface Role {
		public static final int NO_ANY_PRIVILEGE = -1;//无任何权限
		public static final int SUPER_MANAGER = 0;//超级管理员
		public static final int CITY_CENTRAL_BANK_OPERATOR = 1;//地市中支操作员
		public static final int DISTRICT_CENTRAL_BANK_OPERATOR = 2;//县人行操作员
		public static final int BANK_LEVEL1_OPERATOR = 3;//商业银行一级操作员
		public static final int BANK_LEVEL2_OPERAOTR = 4;//商业银行二级操作员
	}
	
	/**
	 * 征信系统用户信息
	 */
	
	public interface CreditUser{
		
		//用户类型
		public enum UserTypeEnum{
			PERSON(0, "个人用户"),
			FIRM(1, "企业用户");
			private int code;
			private String value;
			
			UserTypeEnum(int code, String value){
				this.code = code;
				this.value = value;
			}

			public int getCode() {
				return code;
			}

			public String getValue() {
				return value;
			}
			
			public static UserTypeEnum codeOf(int code){
	            for(UserTypeEnum userTypeEnum : values()){
	                if(userTypeEnum.getCode() == code){
	                    return userTypeEnum;
	                }
	            }
	            return null;
	        }
			
			public static UserTypeEnum searchByValue(String value){
				for(UserTypeEnum userTypeEnum : values()){
					if(userTypeEnum.getValue().equals(value)){
						return userTypeEnum;
					}
				}
				return null;
			}
		}
		//用户状态
		public enum UserStatusEnum{
			NORMAL(0, "正常"),
			LOCKED(1, "锁定"),
			FORBIDDEN(2, "禁用");
			
			private int code;
			private String value;
			
			UserStatusEnum(int code, String value) {
				this.code = code;
				this.value = value;
			}

			public int getCode() {
				return code;
			}

			public String getValue() {
				return value;
			}
			public static UserStatusEnum codeOf(int code){
	            for(UserStatusEnum userStatusEnum : values()){
	                if(userStatusEnum.getCode() == code){
	                    return userStatusEnum;
	                }
	            }
	            return null;
	        }
			public static UserStatusEnum searchByValue(String value){
				for(UserStatusEnum userStatusEnum : values()){
					if(userStatusEnum.getValue().equals(value)){
						return userStatusEnum;
					}
				}
				return null;
			}
		}
		//用户级别
		public enum UserLevelEnum{
			MANAGER(2, "管理员"),
			ORDINARY(3, "普通用户");
			private int code;
			private String value;
			private UserLevelEnum(int code, String value) {
				this.code = code;
				this.value = value;
			}
			public int getCode() {
				return code;
			}
			public String getValue() {
				return value;
			}
			public static UserLevelEnum codeOf(int code){
	            for(UserLevelEnum userLevelEnum : values()){
	                if(userLevelEnum.getCode() == code){
	                    return userLevelEnum;
	                }
	            }
	            return null;
	        }
		}
		//是否签订岗前承诺书
		public enum IsSignedPromiseEnum{
			SIGNED(0, "已签订"),
			UNSIGNED(1, "未签订");
			private int code;
			private String value;
			private IsSignedPromiseEnum(int code, String value) {
				this.code = code;
				this.value = value;
			}
			public int getCode() {
				return code;
			}
			public String getValue() {
				return value;
			}
			public static IsSignedPromiseEnum codeOf(int code){
	            for(IsSignedPromiseEnum isSignedPromiseEnum : values()){
	                if(isSignedPromiseEnum.getCode() == code){
	                    return isSignedPromiseEnum;
	                }
	            }
	            return null;
	        }
		}
	}
	//征信系统用户变更信息常量
	public interface CreditUserUpdate{
		//update_type int comment '本次变更类型，0-用户状态变更，1-用户部门变更',
		public enum UpdateTypeEnum {
			STATUS_CHANGE(0, "用户状态变更"),
			DEP_CHANGE(1, "用户部门变更");
			private int code;
			private String value;
			
			private UpdateTypeEnum(int code, String value){
				this.code = code;
				this.value = value;
			}

			public int getCode() {
				return code;
			}

			public String getValue() {
				return value;
			}
			public static UpdateTypeEnum codeOf(int code){
	            for(UpdateTypeEnum updateTypeEnum : values()){
	                if(updateTypeEnum.getCode() == code){
	                    return updateTypeEnum;
	                }
	            }
	            return null;
	        }
			
		}
	}
	
	//异议管理常量
	public interface Objection {
		public enum SubjectType {
			PERSON(0, "个人"),
			FIRM(1, "企业");
			private int code;
			private String value;
			private SubjectType(int code, String value){
				this.code = code;
				this.value = value;
			}
			public int getCode() {
				return code;
			}

			public String getValue() {
				return value;
			}
			public static SubjectType codeOf(int code){
	            for(SubjectType subjectType : values()){
	                if(subjectType.getCode() == code){
	                    return subjectType;
	                }
	            }
	            return null;
	        }
		}
		public enum ObjectionType{
			COLLECTION(0, "涉及信息采集的异议"),
			QUERY(1, "涉及信息查询的异议"),
			USE(2, "涉及信息使用的异议"),
			SECURITY(3, "涉及信息安全的异议"),
			OTHER(4, "其它");
			private int code;
			private String value;
			private ObjectionType(int code, String value){
				this.code = code;
				this.value = value;
			}
			public int getCode() {
				return code;
			}

			public String getValue() {
				return value;
			}
			public static ObjectionType codeOf(int code){
	            for(ObjectionType objectionType : values()){
	                if(objectionType.getCode() == code){
	                    return objectionType;
	                }
	            }
	            return null;
	        }
		}
		public enum Status{
			UNSOLVE(0, "未解决"),
			SOLVED(1, "已解决"),
			TOHER(2, "其他");
			private int code;
			private String value;
			private Status(int code, String value){
				this.code = code;
				this.value = value;
			}
			public int getCode() {
				return code;
			}

			public String getValue() {
				return value;
			}
			public static Status codeOf(int code){
	            for(Status status : values()){
	                if(status.getCode() == code){
	                    return status;
	                }
	            }
	            return null;
	        }
		}
		public enum Exceed{
			NON_EXCEED(0, "未超期"),
			EXCEED(1, "超期");
			
			private int code;
			private String value;
			private Exceed(int code, String value){
				this.code = code;
				this.value = value;
			}
			public int getCode() {
				return code;
			}

			public String getValue() {
				return value;
			}
			public static Exceed codeOf(int code){
	            for(Exceed exceed : values()){
	                if(exceed.getCode() == code){
	                    return exceed;
	                }
	            }
	            return null;
	        }
		}
	}
	
	//投诉管理常量
	public interface Complaint{
		public enum Status{
			UNSOLVE(0, "未解决"),
			SOLVED(1, "已解决"),
			TOHER(2, "其他");
			private int code;
			private String value;
			private Status(int code, String value){
				this.code = code;
				this.value = value;
			}
			public int getCode() {
				return code;
			}

			public String getValue() {
				return value;
			}
			public static Status codeOf(int code){
	            for(Status status : values()){
	                if(status.getCode() == code){
	                    return status;
	                }
	            }
	            return null;
	        }
		}
		public enum SubjectType {
			PERSON(0, "个人"),
			FIRM(1, "企业");
			private int code;
			private String value;
			private SubjectType(int code, String value){
				this.code = code;
				this.value = value;
			}
			public int getCode() {
				return code;
			}

			public String getValue() {
				return value;
			}
			public static SubjectType codeOf(int code){
	            for(SubjectType subjectType : values()){
	                if(subjectType.getCode() == code){
	                    return subjectType;
	                }
	            }
	            return null;
	        }
		}
		public enum ComplaintType{
			COLLECTION(0, "涉及信息采集的投诉"),
			QUERY(1, "涉及信息查询的投诉"),
			USE(2, "涉及信息使用的投诉"),
			SECURITY(3, "涉及信息安全的投诉"),
			OBJECTION(4, "涉及异议处理的投诉"),
			OTHER(5, "其它");
			private int code;
			private String value;
			private ComplaintType(int code, String value){
				this.code = code;
				this.value = value;
			}
			public int getCode() {
				return code;
			}

			public String getValue() {
				return value;
			}
			public static ComplaintType codeOf(int code){
	            for(ComplaintType complaintType : values()){
	                if(complaintType.getCode() == code){
	                    return complaintType;
	                }
	            }
	            return null;
	        }
		}
		public enum Exceed{
			NON_EXCEED(0, "未超期"),
			EXCEED(1, "超期");
			
			private int code;
			private String value;
			private Exceed(int code, String value){
				this.code = code;
				this.value = value;
			}
			public int getCode() {
				return code;
			}

			public String getValue() {
				return value;
			}
			public static Exceed codeOf(int code){
	            for(Exceed exceed : values()){
	                if(exceed.getCode() == code){
	                    return exceed;
	                }
	            }
	            return null;
	        }
		}
	}
}




























